'use strict';

var wechat = require('co-wechat'),
  config = require('./config');

var myWeChat = function(app) {
  app.use(wechat(config.weChat.token).middleware(function *() {
    console.log(this.path, this.weixin);
    this.status = 200;
    this.body = {type: "text", content: 'Hello world!'};
  }));
};

module.exports = myWeChat;
